﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<B10.Models.PageListViewModel>" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    <%=Request.Url.Authority %>
</asp:Content>
<asp:Content ID="indexHeader" ContentPlaceHolderID="HeaderContent" runat="server">
    <link rel="alternate" type="application/rss+xml" title="RSS" href='<%=Url.Action("Index","Rss")%>' />
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <div class="ui-corner-all ui-helper-clearfix alternate-header" id="tabs">
        <%RouteValueDictionary routeValues = new RouteValueDictionary(this.ViewContext.RouteData.Values);
          routeValues["page"] = routeValues["category"] == null ? "" : "1";
          string s = (string)routeValues["sort"];
          B10.Models.PagesSortOrder sortOrder = !String.IsNullOrEmpty(s) ?
            (B10.Models.PagesSortOrder)Enum.Parse(
            typeof(B10.Models.PagesSortOrder), s) : B10.Models.PagesSortOrder.TopWeek; %>
        <ul>
            <%foreach (B10.Models.PagesSortOrder item in Enum.GetValues(typeof(B10.Models.PagesSortOrder)))
              { %>
            <%if (item == sortOrder)
              { %>
            <li class="selected">
                <%routeValues["sort"] = (int)item;%>
                <%=Html.RouteLink(B10.Models.PageListViewModel.GetSortOrderName(item),routeValues,
                   new Dictionary<string,object>() { {"title", B10.Models.PageListViewModel.GetSortOrderName(item)}} )%>
            </li>
            <%}
              else
              { %>
            <li>
                <%routeValues["sort"] = (int)item;%>
                <%=Html.RouteLink(B10.Models.PageListViewModel.GetSortOrderName(item), routeValues,
                   new Dictionary<string,object>() { {"title", B10.Models.PageListViewModel.GetSortOrderName(item) }})%>
            </li>
            <%} %>
            <%} %>
        </ul>
         <div class="rss right">
                    <a href='<%=Url.Action("Index", "Rss")%>'>RSS</a>
                </div>
        <div class="clear">
        </div>
    </div>
    <div class="break"></div>
    <div class="clear">
    </div>
    <% Html.RenderPartial("PaginatedPageList", Model); %>
</asp:Content>
<asp:Content ID="rightBottomContent" ContentPlaceHolderID="RightColumnBottomContent"
    runat="server">
    <%--<%Html.RenderPartial("SmallPageList", Model.AdditionalPages); %>--%>
</asp:Content>
